<template>
  	<div id="organizationData">
  		<header>
  			<i @click="goBack()"></i>
  			<div>机构基本资料填写</div>
  		</header>
  		<div class="border-8"></div>
    	<ul>
	  		<li>
	  			<a>
					机构名称:
		 			<input v-model="orgData.name" type="text" placeholder="请输入机构名称"  required />
	  			</a>
	  		</li>
	  		<li>
	  			<a>
					联系方式:
		 			<input v-model="orgData.phone" type="number" placeholder="请输入联系方式"  required />
	  			</a>
	  		</li>
	  		<li>
	  			<a>
					联系地址:
		 			<input v-model="orgData.address" type="text" placeholder="请输入联系地址"  required />
	  			</a>
	  		</li>
	  	</ul>
	    <a class="confirmBtn" @click="save">
	  		保 存
	  	</a>
	</div>
</template>
<script>
	export default {
		data() {
			return {
				orgData: {
					name: '',
					phone: '',
					address: ''
				}

			}
		},
		components: {

		},
		methods: {
			goBack() {
				this.$router.push({path:'/authentication'})
			},
			save() {
				if(this.orgData.name&&this.orgData.phone&&this.orgData.address) {
					var params = {
			    		content: JSON.stringify(this.orgData),
			    		img_url: '机构基本资料',
			    	};
			    	localStorage.setItem("authdata", JSON.stringify(params));
			    	this.$router.back();
				}else {
					this.$utils._toast("请检查是否填写完整");
				}
            },
            init() {
                const authdata = JSON.parse(localStorage.getItem("authdata"));
                if(authdata.img_url == '机构基本资料') {
                    this.orgData = JSON.parse(authdata.content);
                }
            }

		},
		created() {
            this.init();
		},
		mounted() {
		}
	}
</script>
<style lang="scss">
</style>
